/*
 * F1.c
 *
 *  Created on: 20/10/2012
 *      Author: Sarah
 */

#include "F1.h"

double F1minX = -100;
double F1maxX = 100;
int F1dimensions = 1000;

double F1Compute(double* x) {
	double result;
	int i;

	double* F1anotherz = malloc(sizeof(double)*F1dimensions);

	double *lookup = lookupprepare(F1dimensions);

	double*F1Ovector = createShiftVector(F1dimensions, F1minX, F1maxX);

	for (i = F1dimensions - 1; i >= 0; i--) {
		F1anotherz[i] = x[i] - F1Ovector[i];
	}

	result = elliptic(F1anotherz, F1dimensions, lookup);

	free(F1Ovector);
	free(F1anotherz);
	free(lookup);

	return (result);
}

int F1GetDimensions() {
	return F1dimensions;
}
double F1GetGetMax() {
	return F1maxX;
}
double F1GetMin() {
	return F1minX;
}
